package com.jinsi.service.zhu.iml;


import com.jinsi.mapper.zhu.AccountMapper;
import com.jinsi.pojo.SyUser;

import com.jinsi.service.zhu.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * 获取用户信息，修改账号
 * @author 朱浩榕
 * @Date 2022-10-13
 */
@Service
@Transactional
public class AccountServiceImpl implements AccountService {


    @Autowired
    private AccountMapper accountMapper;

    /**
     * //获得用户ID
     * @param userId 获得用户ID
     * @return
     */
    @Override
    public SyUser getUser(int userId) {
        return accountMapper.getUser(userId);
    }

    /**
     * //获得用户密码
     * @param userPwd 获得用户登陆的密码
     * @param userId 获得用户登陆的ID
     */
    @Override
    public void updatePwd(String userPwd, Date userUpdateDate, int userId,String userRemark,String userEmail,String userDateBirth) {
       accountMapper.updatePwd(userPwd,userUpdateDate, userId,userRemark,userEmail,userDateBirth);
    }

    /**
     *  //修改用户密码和手机号
     * @param userName 获得用户登陆的名字
     * @param userPwd 获得用户登陆的米啊
     * @param userPhone 获得用户登陆得饿手机号
     * @return
     */
    @Override
    public SyUser getpas(String userName, String userPwd, String userPhone) {
        return accountMapper.getpas(userName,userPwd,userPhone);
    }

    @Override
    public void updataPassword(SyUser syUser) {
        accountMapper.updatePassWord(syUser);
    }

    /**
     * 修改思云用户个人信息
     * @param userId
     * @param userRemark
     * @param userEmail
     * @param userDateBirth
     * @return
     */
    @Override
    public void updataUserData(int userId, String userRemark, String userEmail, Date userDateBirth) {
         accountMapper.updataUserData(userId,userRemark,userEmail,userDateBirth);
    }
}
